using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

using WRM.Windows.Forms;

namespace PropertyTree.Demo
{
	/// <summary>
	/// Summary description for PropertyPane.
	/// </summary>
	public class CustomPane : UserPropertyPane
	{
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button button1;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public CustomPane()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call

		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.label1 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
                | System.Windows.Forms.AnchorStyles.Right);
            this.label1.Location = new System.Drawing.Point(12, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(428, 60);
            this.label1.TabIndex = 0;
            this.label1.Text = @"This is a class derived from UserPropertyPane.  It is created and designed in much the same way as a typical UserControl class.  However, this class can be added to any PropertyTree by simply dragging it from the Toolbox and dropping it onto a PropertyTree.";
            // 
            // button1
            // 
            this.button1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                | System.Windows.Forms.AnchorStyles.Left) 
                | System.Windows.Forms.AnchorStyles.Right);
            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.button1.Location = new System.Drawing.Point(8, 76);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(428, 156);
            this.button1.TabIndex = 1;
            this.button1.Text = "Click me!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // CustomPane
            // 
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.button1,
                                                                          this.label1});
            this.Name = "CustomPane";
            this.Size = new System.Drawing.Size(444, 240);
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
            this.ResumeLayout(false);

        }
		#endregion

        private void button1_Click(object sender, System.EventArgs e)
        {
            MessageBox.Show(
                this,
                "Clicked!\n\n\nThis Click event handler is a part of the CustomPane class.",
                "Event handled",
                MessageBoxButtons.OK,
                MessageBoxIcon.Information);
        }
	}
}
